package me.goldze.mvvmhabit.utils;

import android.Manifest;

import androidx.fragment.app.FragmentActivity;

import com.tbruyelle.rxpermissions2.RxPermissions;


//https://blog.csdn.net/qq_33923079/article/details/53453607
public class RxPermissionsUtils {


    static RxPermissionsUtils rxPermissionsUtils;

    public final String WRITE_EXTERNAL_STORAGE = Manifest.permission.WRITE_EXTERNAL_STORAGE;

    /**
     * 获取单例
     *
     * @return
     */
    public static RxPermissionsUtils getInstance() {
        if (rxPermissionsUtils == null) {
            synchronized (RxPermissionsUtils.class) {
                if (rxPermissionsUtils == null) {
                    rxPermissionsUtils = new RxPermissionsUtils();
                }
            }
        }
        return rxPermissionsUtils;
    }

    public RxPermissions applyPermission(FragmentActivity context) {
        return new RxPermissions(context);
    }

    public void res(FragmentActivity context) {
    }


    public String readWritePermission() {
        return Manifest.permission.CALL_PHONE;
    }


}
